# 统计工具的数量
liandao = 0
futou = 0
class Tools:
    def __init__(self,tool):
        global liandao,futou
        self.tool = tool
        if tool == "镰刀":
            liandao +=1
        elif tool == '斧头':
            futou +=1
        with open('tools.txt','w',encoding='utf-8') as f:
            f.write(f"镰刀数量为：{liandao}，斧头数量为：{futou}")
    @classmethod
    def show_tools_count(self):
        return f"镰刀的数量为：{liandao}，斧头的数量为：{futou}"
if __name__ == '__main__':
    Tools("斧头")
    Tools("斧头")
    Tools("斧头")
    Tools("斧头")
    Tools("斧头")
    Tools("镰刀")
    Tools("镰刀")
    Tools("镰刀")
    Tools("镰刀")
    Tools("镰刀")
    Tools("镰刀")
    print(Tools.show_tools_count())
    # print(Tools.show_tools_count())

